<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!DOCTYPE html>
<!--支付最终页-->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>支付页</title>
    <link rel="stylesheet" type="text/css" href="../userResource/css/payresult.css">
    <link rel="stylesheet" type="text/css" href="../userResource/css/payresultcart.css">
    <link rel="stylesheet" type="text/css" href="../userResource/css/login.css">
</head>
<body style="text-align: left;" id="body">




<!-- 购物车商品主体 -->
<div class="wrap">
    <div class="cart_send">
        <div class="cf send_header">
            <div class="f_left title">
                <h1>提交支付</h1>
            </div>
            <ul class="f_right step">
                <li class="finish"><p><span>1</span></p><font>我的购物车</font></li>
                <li class="finish"><p><span>2</span></p><font>填写核对订单信息</font></li>
                <li class="ongoing"><p><span>3</span></p><font>提交支付</font></li>
            </ul>
        </div>
        <!-- 订单信息 -->
        <div class="orders" style="position:relative;">
            <dl class="cf">
                <dt class="f_left"></dt>
                <dd class="f_left" style="width: 800px;">
                    <p class="title">订单已生成，请您记得在1小时内完成支付，否则需要重新下单哦！</p>
                    <table cellspacing="0" cellpadding="0">
                        <tbody>
                        <tr>
                            <th>订单号：</th>
                            <td><a href="#" class="num" id="oid"></a></td>
                        </tr>
                        <tr>
                            <th>总金额：</th>
                            <td  id="total"></td>
                        </tr>

                        <tr>
                            <th>收件人：</th>
                            <td id="userAndTel">张三 13345678901</td>
                        </tr>

                        <tr>
                            <th>配送地址：</th>
                            <td id="address">河北省 石家庄市 元氏县，河北建设 (051130)</td>
                        </tr>
                        </tbody>
                    </table>
                </dd>
            </dl>
        </div>
        <!-- 付款方式 -->
        <div class="pay_method">
            <p class="title">请选择以下支付方式付款</p>
            <dl>
                <dt>第三方支付</dt>
                <dd class="cf">
                    <a href="javascript:void(0)" value="6"><img src="../userResource/images/payresult/pay001.jpg" width="174" height="60" alt="支付宝" title="支付宝"></a>
                </dd>
            </dl>
        </div>
        <!-- 提交按钮 -->
        <div class="pay_submit">
            <input type="button" value="立即支付" class="submit" onclick="submitForm()">
            <!--需要自己修改订单详情页的弹出以及请求-->
            <input type="button" value="订单详情" class="info" onclick="javascript:window.location.href = 'payDetail.html';">
        </div>
    </div>
</div>


<script src="../vendors/jquery/dist/jquery.min.js"></script>
<!--显示购物车-->
<script type="text/javascript">
    var ctx = '';
    var host_url = '#';
    var static_image_url = '#';
    var sso_service_type = '#';
    var page_id = 'list';
    var mobile = '';
</script>
<!-- 获取数据 -->
<script>
    $(function () {
        $.ajax({
            url:"/order/orderfinal"
            ,type:"POST"
            ,dataType:"JSON"
            ,data:{}
            ,success:function(data){
                switch(data.code) {
                    case 200:
                        renderPage(data.rows);
                        break;
                    default :break;
                }
            }
        })
    })

    function renderPage(data){
        $("#oid").text(data.oid);
        $("#total").text(data.total);
        $("#userAndTel").text(data.relname+" "+data.tel);
        $("#address").text(data.address);
    }

    function submitForm(){
        var data = {};
        //订单

        data.out_trade_no=$("#oid").text();
        data.total_amount=$("#total").text();
        data.body="没有详情";
        data.subject="订单号:"+$("#oid").text();
        $.ajax({
            url: "/alipay/payBeforMoney"
            , type: "POST"
            , data: JSON.stringify(data)
            ,contentType: "application/json"
            ,success:function (data) {
                $("#body").html(data.rows);
            }
        });
    }
</script>
</body></html>
</body>
</html>